package com.xuduo.amd.controller;

import com.xuduo.amd.dto.Users;
import com.xuduo.amd.pojo.JsonResult;
import com.xuduo.amd.service.EamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.naming.NamingException;
import javax.validation.Valid;
import java.util.Map;

@RestController
public class EamUserController {
    @Autowired
    private EamService eamService;
    @RequestMapping(value = "/eam/login", method = RequestMethod.POST)
    public JsonResult login(@RequestBody @Valid Users user) throws NamingException {
        JsonResult response = new JsonResult();
        Map<String, Object> login = eamService.login(user);
        response.setData(login);
        return response;
    }


}
